/*
*
*分销模块接口
*
*/
angular.module("interlocutionService", ["Common"]).service('interlocutionservice', ['Restangular', '$http', '$rootScope', function (Restangular, $http, $rootScope) {

    //  post请求
    //  this.findStatus = function (params) {
    //     return Restangular.one("specialColumn").post( "findStatus",$.param(params));
    // };
	//删除
    this.delAuditInfo = function (params) {
        return Restangular.one("grade").customPOST({ name: "My Message" }, "delAuditInfo", params);
    }
    //查询问卷json
    this.findTopicDetails = function (params) {
        return Restangular.one("questionnaire").customPOST({ name: "My Message" }, "findTopicDetails", params);
    };
    //新增编辑问卷
    this.saveOrEditQuestionnaire = function (params) {
        return Restangular.one("questionnaire").customPOST({ name: "My Message" }, "saveOrEditQuestionnaire", params);
    };
    
    /*************************************************************************************/
    //上传附件
    this.uploadEnclosure = function (params) {
        return $rootScope.fileurl + "/file/uploadEnclosure" + params;
    }


    /*************************************************积分********************************************************/
    //管理端查询学员积分
    this.findStudentIntergalPage = function (params) {
        return Restangular.one("integral").customPOST({ name: "My Message" }, "findStudentIntergalPage", params);
    };
    
    //查询学员积分详情
    this.findStuIntergalDetails = function (params) {
        return Restangular.one("integral").customPOST({ name: "My Message" }, "findStuIntergalDetails", params);
    };
    
    //问卷列表 
    this.findQuestionnairePage = function (params) {
        return Restangular.one("questionnaire").customPOST({ name: "My Message" }, "findQuestionnairePage", params);
    };
    //学员端问卷列表 
    this.findStudentQuestionnairePage = function (params) {
        return Restangular.one("questionnaire").customPOST({ name: "My Message" }, "findStudentQuestionnairePage", params);
    };
    //分配问卷
    this.distributeQuestionnaire = function (params) {
        return Restangular.one("questionnaire").customPOST({ name: "My Message" }, "distributeQuestionnaire", params);
    };
    //删除问卷
    this.delQuestionnaire = function (params) {
        return Restangular.one("questionnaire").customPOST({ name: "My Message" }, "delQuestionnaire", params);
    };
    
    /*****************************************************笔记*******************************************************/

    //查询需审核笔记
    this.findToExamineNote = function (params) {
        return Restangular.one("courseNote").customPOST({ name: "My Message" }, "findToExamineNote", params);
    };
    //删除笔记
    this.delCourseNotes = function (params) {
        return Restangular.one("courseNote").customPOST({ name: "My Message" }, "delCourseNotes", params);
    };
    //审核笔记
    this.ExamineNote = function (params) {
        return Restangular.one("courseNote").customPOST({ name: "My Message" }, "ExamineNote", params);
    };
   
    //查询自定义分类
    this.findClassification = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "findClassification", params);
    };
   
	 //查询是否关注专家
    this.getIsFollExpert= function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "getIsFollExpert", params);
    };
    //查询登录人是否是专家
    this.findSpecialDynamic = function (params) {
        return Restangular.one("interlocution").customPOST({ name: "My Message" }, "findSpecialDynamic", params);
    };
    /***************************************************专栏******************************************************/
    
    //专栏置顶
    this.modifySpecial = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "modifySpecial", params);
    };
    //获取申请列表
    this.getJoinList = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "getJoinList", params);
    };
    //审核
    this.ExaminationJoin = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "ExaminationJoin", params);
    };
    //删除
    this.delJoin = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "delJoin", params);
    };
    //申请加入专栏
    this.joinSpecialColumn = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "joinSpecialColumn", params);
    };

    //是否加入专栏
    this.IsJoinColumn = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "IsJoinColumn", params);
    };

    //查询后端专栏列表
    this.findSclist = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "findSclist", params);
    };

    //查询学员端专栏列表
    this.findStuSclist = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "findStuSclist", params);
    };

    //新增专栏
    this.addSpecialColumn = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "addSpecialColumn", params);
    };

    //删除专栏
    this.delSpecialColumn = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "delSpecialColumn", params);
    };
    //编辑时，回显权限用户
    this.findByXid = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "findByXid", params);
    };

    //收藏专栏
    this.addFollowSC = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "addFollowSC", params);
    };

    //查询是否收藏改专栏
    this.getIsCollcol = function (params) {
        return Restangular.one("specialColumn").customPOST({ name: "My Message" }, "getIsCollcol", params);
    };
    /********************************************问答************************************************************/
    //查询问答列表
    this.findQuestionList = function (params) {
        return Restangular.one("interlocution").customPOST({ name: "My Message" }, "findQuestionList", params);
    };
    //审核问答
    this.toPass = function (params) {
        return Restangular.one("interlocution").customPOST({ name: "My Message" }, "toPass", params);
    };
    //新增编辑问答
    this.saveEditQA = function (params) {
        return Restangular.one("interlocution").customPOST({ name: "My Message" }, "saveEditQA", params);
    };

    //置顶
    this.questionToTop = function (params) {
        return Restangular.one("interlocution").customPOST({ name: "My Message" }, "questionToTop", params);
    };
    //收藏问答
    this.saveCollection = function (params) {
        return Restangular.one("collection").customPOST({ name: "My Message" }, "saveCollection", params);
    };
    //取消收藏问答
    this.delCollection = function (params) {
        return Restangular.one("collection").customPOST({ name: "My Message" }, "delCollection", params);
    };
    //查询问答详细里关联的自定义分类
    this.findClassByQuesId = function (params) {
        return Restangular.one("collection").customPOST({ name: "My Message" }, "findClassByQuesId", params);
    };
    //删除问答
    this.delQA = function (params) {
        return Restangular.one("interlocution").customPOST({ name: "My Message" }, "delQA", params);
    };
    //查询统计
    this.findQaUserDetail = function (params) {
        return Restangular.one("interlocution").customPOST({ name: "My Message" }, "findQaUserDetail", params);
    };
    //新增回复
    this.saveReplay = function (params) {
        return Restangular.one("replay").customPOST({ name: "My Message" }, "saveReplay", params);
    };
    //删除回复
    this.delReplay = function (params) {
        return Restangular.one("replay").customPOST({ name: "My Message" }, "delReplay", params);
    };
    //查询问答列表
    this.findReplay = function (params) {
        return Restangular.one("replay").customPOST({ name: "My Message" }, "findReplay", params);
    };

    //添加或取消点赞
    this.modifyPoint = function (params) {
        return Restangular.one("replay").customPOST({ name: "My Message" }, "modifyPoint", params);
    };

    //添加或取消满意
    this.setManyi = function (params) {
        return Restangular.one("replay").customPOST({ name: "My Message" }, "setManyi", params);
    };

    //修改预览次数
    this.addPreviewNum = function (params) {
        return Restangular.one("replay").customPOST({ name: "My Message" }, "addPreviewNum", params);
    };
} ]);
